Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]Fix bugs in imequalize, adjust_brightness and adjust_contrast #863

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

LXXXXR
Copy link
Contributor

@LXXXXR LXXXXR commented Mar 3, 2021

Hi,

In this pull request, bugs in imequalize, adjust_brightness and adjust_contrast are fixed and unittests are updated.

For imequalize, astpye is missing, which will cause the output to be in wrong type(int64). #861
For adjust_brightness and adjust_contrast, factor could be larger than 1. Clipping is needed since we use float32 to calculate.

Pls kindly take a look. Thank you.

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #863 (6560546) into master (34b552b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #863   +/-   ##
=======================================
  Coverage   66.41%   66.42%           
=======================================
  Files         145      145           
  Lines        8770     8772    +2     
  Branches     1599     1599           
=======================================
+ Hits         5825     5827    +2     
  Misses       2629     2629           
  Partials      316      316           
Flag Coverage Δ
unittests 66.42% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcv/image/photometric.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34b552b...b713bed. Read the comment docs.

@hellock hellock requested a review from MeowZheng March 3, 2021 03:41
Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your nice work. It looks good to me.

@ZwwWayne ZwwWayne merged commit 27e9ede into open-mmlab:master Mar 3, 2021
@@ -166,7 +166,7 @@ def _scale_channel(im, c):
s2 = _scale_channel(img, 1)
s3 = _scale_channel(img, 2)
equalized_img = np.stack([s1, s2, s3], axis=-1)
return equalized_img
return equalized_img.astype((img.dtype))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.astype(img.dtype)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LXXXXR may fix it in #864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants